package com.corpgovernment.organization.service;

import com.corpgovernment.api.organization.model.user.nonemployee.*;
import com.corpgovernment.common.base.Page;
import com.corpgovernment.organization.entity.db.MbOrgNonEmployeeInfo;

import java.util.List;

/**
 * 非员工用户信息service接口
 *
 * @author wangyujue
 */
public interface IOrganizationNonEmployeeService {

    /**
     * 添加非员工用户信息
     *
     * @param request
     * @return
     */
    CreateOrUpdateOrgNonEmployeeResponse createOrUpdate(CreateOrUpdateOrgNonEmployeeRequest request);

    /**
     * 通过部门id or 集团id查询非员工用户列表
     *
     * @param request 部门id or 集团id
     * @return
     */
    Page page(SearchOrgNonEmployeePageRequest request);

    /**
     * 通过uid查询非员工用户信息
     *
     * @param request
     * @return
     */
    GetOrgNonEmployeeResponse find(GetOrgNonEmployeeRequest request);

    /**
     * 删除非员工用户信息
     *
     * @param id
     * @return
     */
    int delete(Long id);

    /**
     * 保存非员工信息
     *
     * @param mbOrgNonEmployeeInfoList
     * @return
     */
    boolean batchSave(List<MbOrgNonEmployeeInfo> mbOrgNonEmployeeInfoList);

    /**
     * 保存
     *
     * @param mbOrgNonEmployeeInfo
     * @return
     */
    boolean save(MbOrgNonEmployeeInfo mbOrgNonEmployeeInfo);

    /**
     * 批量查询
     *
     * @param ids
     * @return
     */
    List<MbOrgNonEmployeeInfo> listByIds(List<Long> ids);

    boolean update(MbOrgNonEmployeeInfo mbOrgNonEmployeeInfo);

    /**
     * 删除用户的非员工
     *
     * @param uid
     * @return
     */
    boolean deleteByUid(String uid);

	/**
	 * 根据名称精确查询
	 * @param name
	 * @return
	 */
	List<MbOrgNonEmployeeInfo> findByName(String name);

    MbOrgNonEmployeeInfo findByUidAndName(String uid, String name);

}
